#!/usr/bin/env python
#-*-coding:utf-8-*-
# ---------------------------------
# version:  1.0
#
# create-time:      <2008/12/03 00:09:05>
# last-update-time: <halida 03/29/2009 21:23:38>
# ---------------------------------
# module : qt lib

import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *

#app
app = QApplication(sys.argv)
def run(widgetClass=None):
    if widgetClass:
        widget = widgetClass()
        widget.init()
        widget.show()
    app.exec_()

#signal and slot
def conn(sender,sendEvent,reciver,reciveEvent=None):
    #send event to a function
    if reciveEvent==None:
        sender.connect(sender,SIGNAL(sendEvent),
                       reciver)
        return
    #send event to a reciver event
    else:
        sender.connect(sender,SIGNAL(sendEvent),
                       reciver,SLOT(reciveEvent))

def emit(sender,event,*args):
    sender.emit(SIGNAL(event),*args)

#other usefull tool:
import logging
logging.basicConfig(level=logging.DEBUG,)
